fix: improve sample error messaging - #1606
Merged
Merged
Conversation
ChongJiaChua
marked this pull request as ready for review
June 25, 2026 10:53
ACLay
reviewed
Jun 26, 2026
Comment on lines
+26
to
+29
| .map((genericTemplate) => genericTemplate.title || 'Untitled sample') | ||
| .join(', '); | ||
|
|
||
| return `The following sample(s) are violating constraints: ${genericTemplateTitles}. Fix the red sections and click "Save and continue" in each sample before continuing.`; |
Contributor
There was a problem hiding this comment.
This looks like it'd work for the samples case in the issue, but generic templates can be used for other things in the questionnaires too, so I don't think we should be hardcoding the text to be about samples.
Contributor
Author
There was a problem hiding this comment.
Yea that's a good point. I've updated the message to be generic rather than specific to samples.
ACLay
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1378
Description
This PR improves validation feedback for generic templates on proposal sample pages. When one or more sample entries are incomplete or contain answers that violate constraints, the parent page now lists the affected sample names instead of showing the generic "All genericTemplates must be completed" message.
Motivation and Context
Users could save draft progress in a generic template with an answer that violated constraints, such as text longer than the configured character limit. This draft save is allowed, but when they later tried to continue from the parent Samples page, they only saw the ambiguous error "All genericTemplates must be completed".
How Has This Been Tested
Added e2e tests.
Fixes
Changes
Depends on
Tests included/Docs Updated?